projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8225f9
)
Add a thin shim around QDateTime to make it more compatible with our C-inspired
author
robertlipe
<robertlipe@gmail.com>
Fri, 12 Aug 2011 04:02:29 +0000
(
04:02
+0000)
committer
robertlipe
<robertlipe@gmail.com>
Fri, 12 Aug 2011 04:02:29 +0000
(
04:02
+0000)
usage for creation_time.
gpsbabel/gbdatetime.h
[new file with mode: 0644]
patch
|
blob
diff --git a/gpsbabel/gbdatetime.h
b/gpsbabel/gbdatetime.h
new file mode 100644
(file)
index 0000000..
6b56171
--- /dev/null
+++ b/
gpsbabel/gbdatetime.h
@@ -0,0
+1,18
@@
+// Copyright ME.
+
+#include <QDateTime>
+
+// As this code began in C, we have several hundred places that set and
+// read creation_time as a time_t. Provide some operator overloads to make
+// that less painful.
+class gbDateTime : public QDateTime {
+public:
+ operator const time_t() const {
+ return this->toTime_t();
+ }
+ const time_t& operator=(const time_t& t) {
+ this->setTime_t(t);
+ }
+};
+
+